package com.leil.project

import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Alignment
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowPlacement
import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.WindowState
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import org.jetbrains.compose.resources.painterResource
import todo.composeapp.generated.resources.Res
import todo.composeapp.generated.resources.todo_icon

fun main() = application {
    // 创建WindowState，设置窗口初始化大小为1200x800
//    val windowState = WindowState(
//        placement = WindowPlacement.Floating,
//        position = WindowPosition.PlatformDefault,
//        width = 1200.dp,
//        height = 800.dp,
//
//
//    )

    val windowState = rememberWindowState(
        placement = WindowPlacement.Floating,
        size = DpSize(1200.dp, 800.dp),
        position = WindowPosition(Alignment.Center),
    )
    Window(
        onCloseRequest = ::exitApplication,
        title = "To Do",
        state = windowState,
        resizable = true,
        icon = painterResource(Res.drawable.todo_icon)
    ) {
        window.minimumSize = java.awt.Dimension(400, 600)
        MaterialTheme {
//            Layout()
            ResponsiveContent()
        }
    }
}